package com.itxx.examination1;

public class Student {
    //键盘录入3个学生信息(姓名,语文成绩,数学成绩,英语成绩)。


    private String name;
    private Integer chineseSocre;
    private Integer mathSocre;
    private Integer englishSocre;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", chineseSocre=" + chineseSocre +
                ", mathSocre=" + mathSocre +
                ", englishSocre=" + englishSocre +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        if (name != null ? !name.equals(student.name) : student.name != null) return false;
        if (chineseSocre != null ? !chineseSocre.equals(student.chineseSocre) : student.chineseSocre != null)
            return false;
        if (mathSocre != null ? !mathSocre.equals(student.mathSocre) : student.mathSocre != null) return false;
        return englishSocre != null ? englishSocre.equals(student.englishSocre) : student.englishSocre == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (chineseSocre != null ? chineseSocre.hashCode() : 0);
        result = 31 * result + (mathSocre != null ? mathSocre.hashCode() : 0);
        result = 31 * result + (englishSocre != null ? englishSocre.hashCode() : 0);
        return result;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getChineseSocre() {
        return chineseSocre;
    }

    public void setChineseSocre(Integer chineseSocre) {
        this.chineseSocre = chineseSocre;
    }

    public Integer getMathSocre() {
        return mathSocre;
    }

    public void setMathSocre(Integer mathSocre) {
        this.mathSocre = mathSocre;
    }

    public Integer getEnglishSocre() {
        return englishSocre;
    }

    public void setEnglishSocre(Integer englishSocre) {
        this.englishSocre = englishSocre;
    }

    public Student(String name, Integer chineseSocre, Integer mathSocre, Integer englishSocre) {
        this.name = name;
        this.chineseSocre = chineseSocre;
        this.mathSocre = mathSocre;
        this.englishSocre = englishSocre;
    }

    public Student() {
    }
}
